package models
{
	import events.ListViewEvent;
	import events.XMLDataEvent;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	

	public class ListViewModel extends EventDispatcher
	{
		private var xmlDataModel:XMLDataModel;
		public var data:XMLList;
		public function ListViewModel()
		{
			super();
			init();
		}
		private function init():void
		{
			xmlDataModel=new XMLDataModel();
			xmlDataModel.addEventListener(XMLDataEvent.XML_LOADED,viewXML);		
		}
		private function viewXML(evt:XMLDataEvent):void
		{
			data=evt.target.dataXML.music;			
			dispatchEvent(new ListViewEvent(ListViewEvent.LIST_LOADED));
		}
	}
}